<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="./vue.js"></script>
    <script>
      const vm = new Vue({
        el: "#app",
        template: `
        <div>
          {{username}}
          <hr>
          <!--指令 取消响应特性-->
          <span v-once>{{count}}</span>
          <hr>
          {{age}}
        </div>
        `,
        data: {
          // 响应式属性 对象属性变化->视图也会变化
          username: "jack",
          count: 0,
        },
        created() {
          setInterval(() => {
            this.count++;
            // this.age++;
          }, 2000);
        },
        methods: {
          say() {
            return this.username;
          },
        },
      });

      vm.age = 20;
    </script>
  </body>
</html>
